package cn.t.core.enums;

import com.google.common.collect.Lists;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class EnumStore {
    private static final Map<String, List<EnumData>> enumDataMap = new ConcurrentHashMap<>();

    public static void addEnum(String name, List<EnumData> datas) {
        enumDataMap.put(name, datas);
    }


    public static List<EnumData> get(String name) {
        return enumDataMap.getOrDefault(name, Lists.newArrayList());
    }

    public static Map<String, List<EnumData>> getAll() {
        return enumDataMap;
    }
}
